<?php $paginator = $this->Paginator; ?>

<section id="Analyst">
    <div class="page-head">
        <div class="container">
            <div class="row">
                <div class="span9 head-text">
                    <h3><span>Payment History</span></h3>
                    <p>List transactions</p>
                </div>
                <div class="span3">
                    <i class="icon icon-calendar"></i>
                </div>						
            </div>
        </div>			
    </div>
    <div class="container">        
        <div class="page-section">
            <div class="row">
                <div class="span3">
                    <p><?php echo $this->Html->link('Add New', '/payment/add', array('class' => 'btn btn-large btn-primary')); ?></p>
                </div>            					
            </div>

            <div class="row">
                <div class="span12 aligncenter">

                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>Date</th>
                                <th>Transaction Id</th>
                                <th>Payment</th>
                                <th>Amount</th>
                                <th>Currency</th>
                                <th>Status</th>
                            </tr>
                        </thead>
                        <tbody>

                            <?php
                            foreach ($rows as $row) :
                                echo "<tr>"
                                . "<td>{$row['Transaction']['date_paid']}</td>"
                                . "<td>{$row['Transaction']['transaction_id']}</td>"
                                . "<td>{$row['Transaction']['payment']}</td>"
                                . "<td>{$row['Transaction']['amount']}</td>"
                                . "<td>{$row['Transaction']['currency']}</td>"
                                . "<td>{$row['Transaction']['payment_status']}</td></tr>";
                            endforeach;
                            ?>

                        </tbody>
                    </table>
                    <div class="span12 pagination">
                        &nbsp;
                        <ul>
                            <?php
                            if ($paginator->hasPrev()) {
                                echo '<li>' . $paginator->prev("Prev") . '</li>';
                            }
                            ?>
                            <?php echo $paginator->numbers(array('modulus' => 3, 'tag' => 'li', 'separator' => '', 'currentTag' => 'a', 'currentClass' => 'active')); ?>
                            <?php
                            if ($paginator->hasNext()) {
                                echo '<li>' . $paginator->next("Next") . '</li>';
                            }
                            ?>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
    </div>
</section>